package com.nsapi.niceschoolapi.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.nsapi.niceschoolapi.entity.PoliticsTypeDB;
import com.nsapi.niceschoolapi.entity.Role;
import com.nsapi.niceschoolapi.mapper.PoliticsMapper;

import com.nsapi.niceschoolapi.mapper.RoleMapper;
import com.nsapi.niceschoolapi.mapper.TeacherMapper;
import com.nsapi.niceschoolapi.service.PoliticsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("politicsService")
public class PoliticsServiceImpl implements PoliticsService {
    @Resource
    private PoliticsMapper politicsMapper;

    @Resource
    private RoleMapper roleMapper;

    @Override //查询全部政治面貌信息
    public List<PoliticsTypeDB> politicsList() {
        return politicsMapper.selectList(null);
    }



    @Override //按角色名称教师信息
    public Role getRoleByName(String name) {
        QueryWrapper<Role> wrapper=new QueryWrapper<Role>();
        wrapper.eq("name",name);
        return roleMapper.selectOne(wrapper);
    }

}
